//
//  SunSupport.m
//  Xspcf
//
//  Created by sunshine on 16/11/2.
//  Copyright © 2016年 小小算盘. All rights reserved.
//

#import "SunSupport.h"

#import "SunWebVC.h"
#import "SunProductDetailVC.h"
#import "SunLoginVC.h"
#import "SunMyCardsVC.h"
#import "SunInputVC.h"
#import "SunGetMoneyVC.h"
#import "SunSecondVC.h"
#import "SunOpenBindVC.h"
#import "JxWebVC.h"
#import "SunMyOrderVC.h"
#import "SunBankDetailVC.h"
#import "SunRecordVC.h"
#import "ColorButton.h"
#import "SunDelegateWebVC.h"
@interface SunSupport()
{
    NSDictionary *_adsData;
}
@end
@implementation SunSupport
static SunSupport *support = nil;
+ (instancetype)shareSupport{
    @synchronized(self)
    {
        if(support==nil){
            support=[[SunSupport alloc]init];
        }
        return support;
    }
}

+ (void)shouldPushController:(NSDictionary *)data {
    id temp = [UIApplication sharedApplication].delegate;
    AppDelegate *delegate = temp;
    UINavigationController *navigation = delegate.tab.selectedViewController;
    NSDictionary *dic = [Sun getUser:USER];
    switch ([[data objectForKey:@"action"]intValue]) {
        case Web:{
            NSString *url = [data objectForKey:@"param"]?[data objectForKey:@"param"]:[data objectForKey:@"url"];
            SunWebVC *vc = [[SunWebVC alloc]init];
            if ([data objectForKey:@"shareTitle"] && [[data objectForKey:@"shareTitle"] length] > 0) {
                vc.share = YES;
                vc.shareData = data;
            }
            if ([data objectForKey:@"title"]) {
                vc.titleName = [data objectForKey:@"title"];
            }
            NSString *str = @"CZfSDQzsuDayjfzE";
            NSString *str1 =@"12345678";
            NSString *token_id=[Utility encryptStr:[NSString stringWithFormat:@"%@",[Sun getUser:ACCESSID]]  Key:str1 IV:nil];
            if ([url containsString:@"/draw/wheel"]) {
                int type = 5;
                NSString *md5Str=[Utility md5:[NSString stringWithFormat:@"source=ios&token_id=%@&type=%d&%@",token_id,type,str]];
                url = [self urldecode:url];
                vc.urlStr = [NSString stringWithFormat:@"%@?source=ios&token_id=%@&type=%d&sign=%@",url,token_id,type,md5Str];
                if (![[NSUserDefaults standardUserDefaults] boolForKey:KLOGIN]) {
                    NSString *md5Str=[Utility md5:[NSString stringWithFormat:@"source=ios&type=%d&%@",type,str]];
                    vc.urlStr = [NSString stringWithFormat:@"%@?source=ios&type=%d&sign=%@",url,type,md5Str];
                }
            }else {
                NSString *md5Str=[Utility md5:[NSString stringWithFormat:@"source=ios&token_id=%@&%@",token_id,str]];
                url = [self urldecode:url];
                vc.urlStr = [NSString stringWithFormat:@"%@?source=ios&token_id=%@&sign=%@",url,token_id,md5Str];
                if (![[NSUserDefaults standardUserDefaults] boolForKey:KLOGIN]) {
                    NSString *md5Str=[Utility md5:[NSString stringWithFormat:@"source=ios&%@",str]];
                    vc.urlStr = [NSString stringWithFormat:@"%@?source=ios&sign=%@",url,md5Str];
                }
            }
            [navigation pushViewController:vc animated:YES];
            break;
        }
        case Product:{
            SunProductDetailVC *vc = [[SunProductDetailVC alloc]init];
            vc.borrowId = [data objectForKey:@"param"]?[data objectForKey:@"param"]:[data objectForKey:@"borrowId"];
            [navigation pushViewController:vc animated:YES];
            break;
        }
        case Login:{
            SunLoginVC *vc = [[SunLoginVC alloc]init];
            vc.isWeb = NO;
            [navigation pushViewController:vc animated:YES];
            break;
        }
        case Nothing:{
            break;
        }
        case Cards:{
            SunMyCardsVC *vc = [[SunMyCardsVC alloc]init];
            [navigation pushViewController:vc animated:YES];
            break;
        }
        case Input:{
            if ([[dic objectForKey:@"status"] intValue] == 3) {
                SunInputVC *vc = [[SunInputVC alloc]init];
                [navigation pushViewController:vc animated:YES];
            }
            break;
        }
        case GetMoney:{
            if ([[dic objectForKey:@"status"] intValue] == 3) {
                SunGetMoneyVC *vc = [[SunGetMoneyVC alloc]init];
                [navigation pushViewController:vc animated:YES];
            }else {
                SunOpenBindVC *vc = [[SunOpenBindVC alloc]init];
                [navigation pushViewController:vc animated:YES];
            }
            break;
        }
        case Messege:{
            break;
        }
        case ProductList:{
            [delegate.tab setSelectedIndex:1];
            [navigation popToRootViewControllerAnimated:YES];
            break;
        }
        case Back:{
            [navigation popViewControllerAnimated:YES];
            break;
        }
        case PayPassword:{
            NSString *url = [NSString stringWithFormat:@"%@%@",KURL,API_PASSWORD];
            [[Sun shareSun]showActivity:navigation.topViewController];
            [HttpRequest postURL:url withParam:nil success:^(id requestDic, NSString *msg) {
                [[Sun shareSun]hideActivity];
                JxWebVC *web = [[JxWebVC alloc]init];
                web.param = [requestDic objectForKey:@"data"];
                web.url = [requestDic objectForKey:@"url"];
                web.title = @"设置存管交易密码";
                [navigation pushViewController:web animated:YES];
            } failure:^(NSString *errorInfo, int code) {
                [[Sun shareSun]hideActivity];
                [[Sun shareSun]showMsg:errorInfo];
            }];
            break;
        }
        case Home:{
            [navigation popToRootViewControllerAnimated:YES];
            break;
        }
        case Order:{
            SunMyOrderVC *vc = [[SunMyOrderVC alloc]init];
            [navigation pushViewController:vc animated:YES];
            break;
        }
        case InputRecord:{
            SunRecordVC *vc = [[SunRecordVC alloc]init];
            vc.type = 2;
            [navigation pushViewController:vc animated:YES];
            break;
        }
        case GetMoneyRecord:{
            SunRecordVC *vc = [[SunRecordVC alloc]init];
            vc.type = 1;
            [navigation pushViewController:vc animated:YES];
            break;
        }
    }
}

+ (NSString *)urldecode:(NSString *)str{
    NSString *decodedString=(__bridge_transfer NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(NULL, (__bridge CFStringRef)str, CFSTR(""), CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding));
    
    return decodedString;
}

- (void)showAlertByImg:(int)index{
    BOOL HaveAccessID = NO;
    NSString *params = [NSString stringWithFormat:@"ad_id=%d&mac=%@",index,[[NSUserDefaults standardUserDefaults] objectForKey:@"ADID"]];
    if ([[NSUserDefaults standardUserDefaults] boolForKey:KLOGIN]) {
        HaveAccessID = YES;
        params = [params stringByAppendingString:[NSString stringWithFormat:@"&user_id=%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"USER_ID"]]];
    }else{
        HaveAccessID = NO;
    }
    NSString *url = [NSString stringWithFormat:@"%@%@",KURL,Kborrow_get_ad_list];
    [HttpRequest postRequestCacheURLStr:url withParameter:params HaveAccessID:HaveAccessID IsHTML:NO success:^(NSDictionary *requestDic, NSString *msg) {
        NSDictionary *data = [[requestDic objectForKey:@"data"]isKindOfClass:[NSArray class]]?[requestDic objectForKey:@"data"][0]:[requestDic objectForKey:@"data"];
        if (data) {
            _adsData = data;
            UIView *view = [[UIView alloc]init];
            UIImageView *img = [[UIImageView alloc]init];
            img.contentMode = UIViewContentModeScaleAspectFit;
            img.image = [UIImage imageWithData: [NSData dataWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",KIMG,[data objectForKey:@"img"]]]]];
            img.userInteractionEnabled = YES;
            UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(adsTap)];
            [img addGestureRecognizer:tap];
            [view addSubview:img];
            [img lt_XcenterTo:nil save:YES];
            [img lt_setWidth:X(320) save:YES];
            [img lt_heightRelyWidth:(img.image.size.height / img.image.size.width) save:YES];
            UIButton *btn = [[UIButton alloc]init];
            [view addSubview:btn];
            [btn lt_setTop:Y(10) to:img save:YES];
            [btn lt_setSize:CGSizeMake(X(60), X(60)) save:YES];
            [btn lt_XcenterTo:nil save:YES];
            [btn setImage:[UIImage imageNamed:@"tool_bigcancel"] forState:UIControlStateNormal];
            [btn addTarget:self action:@selector(hide) forControlEvents:UIControlEventTouchUpInside];
            [[Sun shareSun]show:view to:[UIApplication sharedApplication].keyWindow shouldReturn:NO];
            [view lt_XYcenterTo:nil save:YES];
            [view lt_topEqual:img save:YES];
            [view lt_leftEqual:img save:YES];
            [view lt_rightEqual:img save:YES];
            [view lt_bottomEqual:btn save:YES];
        }
    } failure:^(NSString *errorInfo, int code) {
    }];
}

- (void)hide{
    [[Sun shareSun]hideShow];
}

- (void)adsTap{
    [[Sun shareSun]hideShow];
    [SunSupport shouldPushController:_adsData];
}

+ (void)shouldAlert:(UIViewController *)target code:(SunUser) code{
    switch (code) {
        case UserOpen:{
            // 提示 开通存管账户
            UIView *backView = [[UIView alloc]init];
            backView.backgroundColor = [UIColor clearColor];
            UIView *view = [[UIView alloc]init];
            view.backgroundColor = [UIColor whiteColor];
            view.layer.cornerRadius = 5;
            [view setFrame:CGRectMake(0, 35, X(300), Y(280))];
            [backView addSubview:view];
            UIImageView *img3 = [[UIImageView alloc]init];
            [backView addSubview:img3];
            [img3 lt_XcenterTo:nil save:YES];
            [img3 lt_setTop:0 to:nil save:YES];
            [img3 lt_setSize:CGSizeMake(Y(75), Y(75)) save:YES];
            img3.image = [UIImage imageNamed:@"goOpen"];
            UILabel *title = [[UILabel alloc]init];
            [view addSubview:title];
            [title lt_XcenterTo:nil save:YES];
            [title lt_setTop:Y(65) to:nil save:YES];
            title.font = FONT(17);
            title.textColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.87];
            title.text = @"小算盘理财携手恒丰银行";
            UILabel *l3 = [[UILabel alloc]init];
            [view addSubview:l3];
            [l3 lt_XcenterTo:nil save:YES];
            [l3 lt_setTop:Y(12) to:title save:YES];
            l3.textColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.87];
            l3.font = FONT(15);
            l3.text = @"个人账户升级为恒丰银行存管账户";
            UILabel *l4 = [[UILabel alloc]init];
            [view addSubview:l4];
            [l4 lt_setTop:Y(37) to:l3 save:YES];
            [l4 lt_XcenterTo:nil save:YES];
            l4.textColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.54];
            l4.font = FONT(12);
            l4.text = @"为保障您的资金安全，需先开通存管账户";
            UIButton *btn = [[UIButton alloc]init];
            [view addSubview:btn];
            [btn lt_XcenterTo:nil save:YES];
            [btn lt_setTop:Y(7) to:l4 save:YES];
            NSMutableAttributedString *detailString = [[NSMutableAttributedString alloc]initWithString:@"了解详情>"];
            NSRange strRange = {0,[detailString length]};
            [detailString addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:strRange];
            [detailString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:0 green:0 blue:0 alpha:0.54] range:strRange];
            [btn setAttributedTitle:detailString forState:UIControlStateNormal];
            [btn setTitleColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:0.54] forState:UIControlStateNormal];
            btn.titleLabel.font = FONT(12);
            [btn doclick:^{
                NSString *url = [NSString stringWithFormat:@"%@/topic/intro_bank_custody?source=ios",KWAP];
                SunWebVC *web = [[SunWebVC alloc]init];
                web.urlStr = url;
                [target.navigationController pushViewController:web animated:YES];
            }];
            // 边框按钮 取消
            UIButton *cancelBtn = [[UIButton alloc]initWithFrame:CGRectMake(30, 100, 215, 35)];
            [view addSubview:cancelBtn];
            [cancelBtn.layer setMasksToBounds:YES];
            cancelBtn.layer.cornerRadius = 35/2.0;
            [cancelBtn.layer setBorderWidth:1];
            CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
            CGColorRef colorref = CGColorCreate(colorSpace,(CGFloat[]){ 10/255.0, 188/255.0, 166/255.0, 1 });
            [cancelBtn.layer setBorderColor:colorref];
            [cancelBtn setTitle:@"取消" forState:UIControlStateNormal];
            [cancelBtn setTitleColor:[UIColor colorWithRed:13/255.0 green:183/255.0 blue:167/255.0 alpha:1] forState:UIControlStateNormal];
            [cancelBtn lt_setTop:Y(14) to:btn save:YES];
            [cancelBtn lt_setWidth:X(85) save:YES];
            [cancelBtn lt_setLeft:X(30) to:nil save:YES];
            [cancelBtn doclick:^{
                [[Sun shareSun]hideAll];
            }];
            // 渐变色按钮 去开通
            NSMutableArray *colorArray1 = [@[[UIColor colorWithRed:14.0/255.0 green:188.0/255.0 blue:173.0/255.0 alpha:1],[UIColor colorWithRed:44.0/255.0 green:199.0/255.0 blue:172.0/255.0 alpha:1]] mutableCopy];
            ColorButton *goOpenBtn = [[ColorButton alloc]initWithFrame:CGRectMake(100, 200, 115, 35) FromColorArray:colorArray1 ByGradientType:leftToRight];
            [goOpenBtn setTitle:@"去开通" forState:UIControlStateNormal];
            goOpenBtn.layer.cornerRadius = 35/2.0;
            [view addSubview:goOpenBtn];
            [goOpenBtn doclick:^{
                [[Sun shareSun]hideAll];
                SunOpenBindVC *vc = [[SunOpenBindVC alloc]init];
                [target.navigationController pushViewController:vc animated:YES];
            }];
            [goOpenBtn lt_setTop:Y(14) to:btn save:YES];
            [goOpenBtn lt_setRight:X(30) to:nil save:YES];
            
            [[Sun shareSun]show:backView to:target shouldReturn:YES];

            [backView lt_setSize:CGSizeMake(X(300), Y(310)) save:YES];
            [backView lt_XYcenterTo:nil save:YES];
            
            break;
        }
        case UserBind:{
            [[Sun shareSun]alertAlign:NSTextAlignmentCenter title:@"温馨提示" content:@"您还未绑定银行卡，请先绑卡！" left:@"去设置" right:@"稍后再说" cancel:^{
                SunOpenBindVC *vc = [[SunOpenBindVC alloc]init];
                [target.navigationController pushViewController:vc animated:YES];
                [[Sun shareSun]hideAll];
            } sure:^{
                [[Sun shareSun]hideAll];
            } To:target];
            break;
        }
        case UserPassword:{
            [[Sun shareSun]alertAlign:NSTextAlignmentCenter title:@"温馨提示" content:@"请设置银行存管交易密码以便您能正常理财" left:@"去设置" right:@"稍后再说" cancel:^{
                
                
//                NSString *url = [NSString stringWithFormat:@"%@%@",KURL,API_PASSWORD];
//                [[Sun shareSun]showActivity:target];
//                [HttpRequest postURL:url withParam:nil success:^(id requestDic, NSString *msg) {
//                    [[Sun shareSun]hideActivity];
//                    JxWebVC *web = [[JxWebVC alloc]init];
//                    web.param = [requestDic objectForKey:@"data"];
//                    web.url = [requestDic objectForKey:@"url"];
//                    web.title = @"设置存管交易密码";
//                    [target.navigationController pushViewController:web animated:YES];
//                } failure:^(NSString *errorInfo, int code) {
//                    [[Sun shareSun]hideActivity];
//                    [[Sun shareSun]showMsg:errorInfo];
//                }];
                NSString *url = [NSString stringWithFormat:@"%@%@",KURL,API_PASSWORD];
//                [[Sun shareSun]showActivity:self];
                SunDelegateWebVC *vc = [[SunDelegateWebVC alloc]init];
                NSString *type = @"0";

                NSDictionary *param = @{@"device":@"iOS",@"type":type};
                NSString *str = [Sun stringFromDictionary:(NSDictionary *)param];
                vc.params = str;
                vc.urlStr = url;
                vc.title = @"设置支付密码";
                
                [target.navigationController pushViewController:vc animated:YES];
                
                
                [[Sun shareSun]hideAll];
            } sure:^{
                [[Sun shareSun]hideAll];
            } To:target];
            break;
        }
        case UserBankCode:{
            [[Sun shareSun]alertAlign:NSTextAlignmentCenter title:@"温馨提示" content:@"小算盘已接入恒丰银行存管系统，提现金额大于5万，需要提现银行卡的开户行联行号。" left:@"去设置" right:@"稍后再说" cancel:^{
                SunBankDetailVC *vc = [[SunBankDetailVC alloc]init];
                [target.navigationController pushViewController:vc animated:YES];
                [[Sun shareSun]hideAll];
            } sure:^{
                [[Sun shareSun]hideAll];
            } To:target];
            break;
        }
        case UserCompany:{
            [[Sun shareSun]alertAlign:NSTextAlignmentCenter title:@"温馨提示" content:@"小算盘财富已接入恒丰银行存管系统，应银行要求，提现时需先设置提现银行卡的开户行联行号。" left:@"去设置" right:@"稍后再说" cancel:^{
                SunBankDetailVC *vc = [[SunBankDetailVC alloc]init];
                [target.navigationController pushViewController:vc animated:YES];
                [[Sun shareSun]hideAll];
            } sure:^{
                [[Sun shareSun]hideAll];
            } To:target];
            break;
        }
        case UserActivate:{
            // 提示 激活
            UIView *backView = [[UIView alloc]init];
            backView.backgroundColor = [UIColor clearColor];
            UIView *view = [[UIView alloc]init];
            view.backgroundColor = [UIColor whiteColor];
            view.layer.cornerRadius = 5;
            [view setFrame:CGRectMake(0, 35, X(300), Y(280))];
            [backView addSubview:view];
            UIImageView *img3 = [[UIImageView alloc]init];
            [backView addSubview:img3];
            [img3 lt_XcenterTo:nil save:YES];
            [img3 lt_setTop:0 to:nil save:YES];
            [img3 lt_setSize:CGSizeMake(Y(75), Y(75)) save:YES];
            img3.image = [UIImage imageNamed:@"goOpen"];
            UILabel *title = [[UILabel alloc]init];
            [view addSubview:title];
            [title lt_XcenterTo:nil save:YES];
            [title lt_setTop:Y(65) to:nil save:YES];
            title.font = FONT(17);
            title.textColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.87];
            title.text = @"小算盘理财携手恒丰银行";
            UILabel *l3 = [[UILabel alloc]init];
            [view addSubview:l3];
            [l3 lt_XcenterTo:nil save:YES];
            [l3 lt_setTop:Y(12) to:title save:YES];
            l3.textColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.87];
            l3.font = FONT(15);
            l3.text = @"个人账户升级为恒丰银行存管账户";
            UILabel *l4 = [[UILabel alloc]init];
            [view addSubview:l4];
            [l4 lt_setTop:Y(37) to:l3 save:YES];
            [l4 lt_XcenterTo:nil save:YES];
            l4.textColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.54];
            l4.font = FONT(12);
            l4.text = @"为保障您的资金安全，需先激活存管账户";
            UIButton *btn = [[UIButton alloc]init];
            [view addSubview:btn];
            [btn lt_XcenterTo:nil save:YES];
            [btn lt_setTop:Y(7) to:l4 save:YES];
            NSMutableAttributedString *detailString = [[NSMutableAttributedString alloc]initWithString:@"了解详情>"];
            NSRange strRange = {0,[detailString length]};
            [detailString addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:strRange];
            [detailString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:0 green:0 blue:0 alpha:0.54] range:strRange];
            [btn setAttributedTitle:detailString forState:UIControlStateNormal];
            [btn setTitleColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:0.54] forState:UIControlStateNormal];
            btn.titleLabel.font = FONT(12);
            [btn doclick:^{
                NSString *url = [NSString stringWithFormat:@"%@/topic/intro_bank_custody?source=ios",KWAP];
                SunWebVC *web = [[SunWebVC alloc]init];
                web.urlStr = url;
                [target.navigationController pushViewController:web animated:YES];
            }];
            // 边框按钮 取消
            UIButton *cancelBtn = [[UIButton alloc]initWithFrame:CGRectMake(30, 100, 215, 35)];
            [view addSubview:cancelBtn];
            [cancelBtn.layer setMasksToBounds:YES];
            cancelBtn.layer.cornerRadius = 35/2.0;
            [cancelBtn.layer setBorderWidth:1];
            CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
            CGColorRef colorref = CGColorCreate(colorSpace,(CGFloat[]){ 10/255.0, 188/255.0, 166/255.0, 1 });
            [cancelBtn.layer setBorderColor:colorref];
            [cancelBtn setTitle:@"取消" forState:UIControlStateNormal];
            [cancelBtn setTitleColor:[UIColor colorWithRed:13/255.0 green:183/255.0 blue:167/255.0 alpha:1] forState:UIControlStateNormal];
            [cancelBtn lt_setTop:Y(14) to:btn save:YES];
            [cancelBtn lt_setWidth:X(85) save:YES];
            [cancelBtn lt_setLeft:X(30) to:nil save:YES];
            [cancelBtn doclick:^{
                [[Sun shareSun]hideAll];
            }];
            // 渐变色按钮 去开通
            NSMutableArray *colorArray1 = [@[[UIColor colorWithRed:14.0/255.0 green:188.0/255.0 blue:173.0/255.0 alpha:1],[UIColor colorWithRed:44.0/255.0 green:199.0/255.0 blue:172.0/255.0 alpha:1]] mutableCopy];
            ColorButton *goOpenBtn = [[ColorButton alloc]initWithFrame:CGRectMake(100, 200, 115, 35) FromColorArray:colorArray1 ByGradientType:leftToRight];
            [goOpenBtn setTitle:@"去激活" forState:UIControlStateNormal];
            goOpenBtn.layer.cornerRadius = 35/2.0;
            [view addSubview:goOpenBtn];
            [goOpenBtn doclick:^{
                [[Sun shareSun]hideAll];
                // 激活界面
                NSString *url = [NSString stringWithFormat:@"%@%@",KURL,API_USERACTIVATE];
                NSDictionary *param = @{@"device":@"iOS"};
                // 加密
                NSString *str = [Sun stringFromDictionary:(NSDictionary *)param];
                // 界面
                SunDelegateWebVC *vc = [[SunDelegateWebVC alloc]init];
                vc.params = str;
                vc.urlStr = url;
                vc.type = OpenBind;
                vc.title = @"激活";
                [target.navigationController pushViewController:vc animated:YES];
                
            }];
            [goOpenBtn lt_setTop:Y(14) to:btn save:YES];
            [goOpenBtn lt_setRight:X(30) to:nil save:YES];
            
            [[Sun shareSun]show:backView to:target shouldReturn:YES];
            
            [backView lt_setSize:CGSizeMake(X(300), Y(310)) save:YES];
            [backView lt_XYcenterTo:nil save:YES];
            
            break;
        }
        default:
            break;
    }
}

@end
